package com.ruoyi.recycle.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.recycle.domain.EssayQuestion;
import com.ruoyi.recycle.mapper.EssayQuestionMapper;
import com.ruoyi.recycle.service.IEssayQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 问答库设置Service业务层处理
 *
 * @author Wubk
 * @date 2022-05-22
 */
@Service
public class EssayQuestionServiceImpl extends ServiceImpl<EssayQuestionMapper, EssayQuestion> implements IEssayQuestionService {
    @Autowired
    private EssayQuestionMapper essayQuestionMapper;

    /**
     * 查询问答库设置
     *
     * @param id 问答库设置主键
     * @return 问答库设置
     */
    @Override
    public EssayQuestion selectEssayQuestionById(Long id) {
        return essayQuestionMapper.selectEssayQuestionById(id);
    }

    /**
     * 查询问答库设置列表
     *
     * @param essayQuestion 问答库设置
     * @return 问答库设置
     */
    @Override
    public List<EssayQuestion> selectEssayQuestionList(EssayQuestion essayQuestion) {
        return essayQuestionMapper.selectEssayQuestionList(essayQuestion);
    }

    /**
     * 新增问答库设置
     *
     * @param essayQuestion 问答库设置
     * @return 结果
     */
    @Override
    public int insertEssayQuestion(EssayQuestion essayQuestion) {
        return essayQuestionMapper.insertEssayQuestion(essayQuestion);
    }

    /**
     * 修改问答库设置
     *
     * @param essayQuestion 问答库设置
     * @return 结果
     */
    @Override
    public int updateEssayQuestion(EssayQuestion essayQuestion) {
        return essayQuestionMapper.updateEssayQuestion(essayQuestion);
    }

    /**
     * 批量删除问答库设置
     *
     * @param ids 需要删除的问答库设置主键
     * @return 结果
     */
    @Override
    public int deleteEssayQuestionByIds(Long[] ids) {
        return essayQuestionMapper.deleteEssayQuestionByIds(ids);
    }

    /**
     * 删除问答库设置信息
     *
     * @param id 问答库设置主键
     * @return 结果
     */
    @Override
    public int deleteEssayQuestionById(Long id) {
        return essayQuestionMapper.deleteEssayQuestionById(id);
    }
}
